package com.umeng.analytics;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Message;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONObject;

public class MobclickAgentJSInterface
{
  private Context a;

  public MobclickAgentJSInterface(Context paramContext, WebView paramWebView)
  {
    this.a = paramContext;
    paramWebView.getSettings().setJavaScriptEnabled(true);
    paramWebView.setWebChromeClient(new a(null));
  }

  public MobclickAgentJSInterface(Context paramContext, WebView paramWebView, WebChromeClient paramWebChromeClient)
  {
    this.a = paramContext;
    paramWebView.getSettings().setJavaScriptEnabled(true);
    paramWebView.setWebChromeClient(new a(paramWebChromeClient));
  }

  final class a extends WebChromeClient
  {
    WebChromeClient a = null;
    private final String c = "ekv";
    private final String d = "event";

    public a(WebChromeClient paramWebChromeClient)
    {
      if (paramWebChromeClient == null)
      {
        this.a = new WebChromeClient();
        return;
      }
      this.a = paramWebChromeClient;
    }

    public void onCloseWindow(WebView paramWebView)
    {
      this.a.onCloseWindow(paramWebView);
    }

    public boolean onCreateWindow(WebView paramWebView, boolean paramBoolean1, boolean paramBoolean2, Message paramMessage)
    {
      return this.a.onCreateWindow(paramWebView, paramBoolean1, paramBoolean2, paramMessage);
    }

    public boolean onJsAlert(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
    {
      return this.a.onJsAlert(paramWebView, paramString1, paramString2, paramJsResult);
    }

    public boolean onJsBeforeUnload(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
    {
      return this.a.onJsBeforeUnload(paramWebView, paramString1, paramString2, paramJsResult);
    }

    public boolean onJsConfirm(WebView paramWebView, String paramString1, String paramString2, JsResult paramJsResult)
    {
      return this.a.onJsConfirm(paramWebView, paramString1, paramString2, paramJsResult);
    }

    public boolean onJsPrompt(WebView paramWebView, String paramString1, String paramString2, String paramString3, JsPromptResult paramJsPromptResult)
    {
      if ("ekv".equals(paramString2));
      while (true)
        try
        {
          label91: int j;
          Iterator localIterator;
          JSONObject localJSONObject2 = new JSONObject(paramString3);
          HashMap localHashMap = new HashMap();
          String str1 = (String)localJSONObject2.remove("id");
          if (localJSONObject2.isNull("duration"));
          for (int i = 0; ; j = ((Integer)localJSONObject2.remove("duration")).intValue())
          {
            localIterator = localJSONObject2.keys();
            if (localIterator.hasNext())
              break;
            MobclickAgent.a().a(MobclickAgentJSInterface.a(MobclickAgentJSInterface.this), str1, localHashMap, i);
            paramJsPromptResult.confirm();
            return true;
          }
          String str2 = (String)localIterator.next();
          localHashMap.put(str2, localJSONObject2.getString(str2));
        }
        catch (Exception localException2)
        {
          while (true)
          {
            localException2.printStackTrace();
            break label91:
            if (!("event".equals(paramString2)))
              break label220;
            try
            {
              JSONObject localJSONObject1 = new JSONObject(paramString3);
              MobclickAgent.a().a(MobclickAgentJSInterface.a(MobclickAgentJSInterface.this), localJSONObject1.getString("tag"), localJSONObject1.optString("label"), localJSONObject1.optInt("duration"), 1);
            }
            catch (Exception localException1)
            {
            }
          }
          break label91:
        }
      label220: return this.a.onJsPrompt(paramWebView, paramString1, paramString2, paramString3, paramJsPromptResult);
    }

    public void onProgressChanged(WebView paramWebView, int paramInt)
    {
      this.a.onProgressChanged(paramWebView, paramInt);
    }

    public void onReceivedIcon(WebView paramWebView, Bitmap paramBitmap)
    {
      this.a.onReceivedIcon(paramWebView, paramBitmap);
    }

    public void onReceivedTitle(WebView paramWebView, String paramString)
    {
      this.a.onReceivedTitle(paramWebView, paramString);
    }

    public void onRequestFocus(WebView paramWebView)
    {
      this.a.onRequestFocus(paramWebView);
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     com.umeng.analytics.MobclickAgentJSInterface
 * JD-Core Version:    0.5.2
 */